package com.csx.framework.springboot.sample;

import com.csx.framework.springboot.sample.boot.J10FactoryBean;
import com.csx.framework.springboot.sample.event.CustomApplicationEvent;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;

/**
 * <p> what does this class do ? </p>
 * <p> How does it work ?</p>
 * <p> Why does it do this ?</p>
 *
 * @author cuisongxu
 * @date 2023/8/16 周三 15:12
 */
@SpringBootApplication
public class SpringBootSampleApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(SpringBootSampleApplication.class, args);
//        applicationContext.registerShutdownHook();
        applicationContext.publishEvent(new CustomApplicationEvent(1L));
        J10FactoryBean.TestFactoryBean bean = applicationContext.getBean(J10FactoryBean.TestFactoryBean.class);
    }
}
